/*
 * Copyright (C) 2009 Otávio Scherer Garcia 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language governing permissions and limitations under the
 * License.
 */
package com.googlecode.technorati4j.entity;

import org.jdom.Element;

/**
 * The author information.
 * 
 * @author Otávio Scherer Garcia
 * @version $Revision$
 */
public final class Author {

    /**
     * The author username.
     */
    private String username;

    /**
     * The name.
     */
    private String name;

    private String description;

    /**
     * The author website.
     */
    private String url;

    /**
     * URL to user photo.
     */
    private String photoUrl;

    public Author(Element element) {
        username = element.getChildText("username");
        name = element.getChildText("name");
        description = element.getChildText("description");
        url = element.getChildText("url");
        photoUrl = element.getChildText("photourl");
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPhotoUrl() {
        return photoUrl;
    }

    public void setPhotoUrl(String photoUrl) {
        this.photoUrl = photoUrl;
    }

    @Override
    public String toString() {
        final StringBuilder str = new StringBuilder();
        str.append("username=");
        str.append(username);
        str.append("&name=");
        str.append(name);
        str.append("&description=");
        str.append(description);
        str.append("&url=");
        str.append(url);
        str.append("&photoUrl=");
        str.append(photoUrl);

        return str.toString();
    }

}
